/* ===== v3.14 — teal accent kept; <em> = #2F8F4E; no “?” chevrons; menu text-align modes ===== */

*,
*::before,
*::after{ box-sizing:border-box; }

:root{
  --brand-900:#034769;
  --brand-700:#086FA1;
  --brand-400:#3CA0D0;
  --accent:#FF8900;

  /* accents */
  --teal:#559088;                 /* menu + inputs accent */
  --teal-16: rgba(85,144,136,.16);
  --teal-22: rgba(85,144,136,.22);
  --teal-28: rgba(85,144,136,.28);
  --teal-35: rgba(85,144,136,.35);
  --teal-45: rgba(85,144,136,.45);

  --em:#2F8F4E;                   /* emphasis color for <em> */

  --text:#16232a;
  --muted:#5f7784;
  --card:#ffffff;

  --hi-warm-bg:#FFF4E6;
  --hi-warm-fg:#8A4B00;

  --r-xl:20px; --r-lg:14px; --r-md:12px; --pill:999px;

  --shadow-md:0 8px 24px rgba(0,0,0,.12);
  --ring:0 0 0 3px rgba(60,160,208,.35);

  --speed-fast:180ms; --speed-med:360ms; --speed-slow:700ms;

  --max:900px;

  --menuTop:12px;
  --menuSearchH:46px;
  --menuGap:6px;
  --menuLogoutH:48px;
  --menuHeaderH: calc(var(--menuTop) + var(--menuSearchH) + var(--menuGap) + var(--menuLogoutH) + var(--menuTop));

  --hamburgerSafe:78px;
}

/* ---------- Background ---------- */
html, body{
  margin:0; padding:0; width:100%; min-height:100vh;
  color:var(--text);
  font-family: Inter, "Noto Sans", system-ui, -apple-system, "Segoe UI",
               Roboto, "Helvetica Neue", Arial, "Liberation Sans", sans-serif;
  background: linear-gradient(135deg, #034769 0%, #086FA1 45%, #3CA0D0 100%);
  background-size:180% 180%;
  animation:bgShift 90s ease infinite;
  overflow-x:hidden;
  font-size:16px;
}
@keyframes bgShift{0%{background-position:0% 50%}50%{background-position:100% 50%}100%{background-position:0% 50%}}

/* ---------- Bubbles ---------- */
.particle-container{ position:fixed; inset:0; z-index:0; overflow:hidden; pointer-events:none; }
.bubble{ position:absolute; bottom:-100px; background:rgba(255,255,255,.22); border-radius:50%; opacity:.6; animation:float 40s ease-in-out infinite; }
.bubble.small{width:30px;height:30px} .bubble.medium{width:60px;height:60px} .bubble.large{width:100px;height:100px}
@keyframes float{0%{transform:translateY(0)}50%{transform:translateY(-50vh)}100%{transform:translateY(0)}}
.particle-container .bubble:nth-child(1){left:20%; animation-duration:40s}
.particle-container .bubble:nth-child(2){left:40%; animation-duration:45s}
.particle-container .bubble:nth-child(3){left:60%; animation-duration:50s}
.particle-container .bubble:nth-child(4){left:80%; animation-duration:55s}
.particle-container .bubble:nth-child(5){left:10%; animation-duration:35s}

/* ---------- Content ---------- */
.blur-layer{ position:relative; z-index:1; width:100%; padding:20px; transition:filter var(--speed-slow) ease; }
body.menu-open .blur-layer{ filter:blur(4px); }
body.menu-open::after{ content:""; position:fixed; inset:0; background:rgba(0,0,0,.35); z-index:1001; }

.content{ display:flex; flex-direction:column; align-items:center; padding:20px; }
.stylized-background{
  width:100%; max-width:var(--max); margin:0 auto;
  border:1px solid transparent;
  border-radius:var(--r-xl);
  box-shadow:var(--shadow-md);
  padding:26px; line-height:1.85; position:relative;
  background:
    linear-gradient(#fff,#fff) padding-box,
    linear-gradient(90deg, var(--teal), var(--brand-400)) border-box;
}
.stylized-background::after{
  content:''; position:absolute; inset:0;
  background-image:url('https://www.transparenttextures.com/patterns/diagonal-noise.png');
  opacity:.05; border-radius:inherit; pointer-events:none;
}

/* ---------- Typography ---------- */
.stylized-background h2,
.stylized-background h3,
.stylized-background h4{
  margin:0 0 14px; text-align:center; font-weight:800; color:var(--brand-900);
  letter-spacing:.1px;
}
.stylized-background h2{ font-size:1.9rem; line-height:1.25; }
.stylized-background h3{ font-size:1.35rem; color:var(--brand-700); position:relative; padding-bottom:6px; }
.stylized-background h3::after{
  content:""; position:absolute; left:50%; transform:translateX(-50%);
  bottom:0; width:120px; height:3px; border-radius:3px;
  background:linear-gradient(90deg, var(--teal), var(--brand-700));
  opacity:.85;
}
.stylized-background h4{ font-size:1.15rem; color:var(--brand-700); }

.stylized-background p{ margin:0 0 16px; font-size:1.08rem; line-height:1.85; text-align:left; hyphens:auto; }
.stylized-background p em{ font-style:italic; font-weight:600; color:var(--em); }
.stylized-background p strong{
  font-weight:800; color:var(--brand-900);
  background: rgba(60,160,208,.14);
  padding:3px 8px; border-radius:8px; box-decoration-break:clone;
}
.stylized-background mark{
  background: color-mix(in oklab, var(--hi-warm-bg) 75%, #fff 25%);
  color:var(--hi-warm-fg); padding:2px 6px; border-radius:6px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.05);
}

/* Lists */
.stylized-background ul{ margin:8px 0 16px 22px; padding-inline-start:22px; }
.stylized-background ul li{ margin-bottom:10px; }
.stylized-background ul li::marker{ color:var(--brand-700); }

/* ---------- Buttons (generic) ---------- */
.custom-btn, #admin-button, #teacher-button, .logout-button{
  display:inline-flex; align-items:center; justify-content:center;
  height:48px; padding:0 22px; border-radius:var(--pill);
  border:2px solid var(--brand-900);
  background:#EEF3F6; color:var(--brand-900);
  font-weight:800; letter-spacing:.2px;
  transition: background var(--speed-slow), color var(--speed-slow), transform var(--speed-fast), box-shadow var(--speed-fast);
  text-decoration:none;
}
.custom-btn:hover, #admin-button:hover, #teacher-button:hover, .logout-button:hover{
  background:var(--accent); color:#fff; transform:translateY(-1px);
}
.custom-btn:focus-visible, #admin-button:focus-visible, #teacher-button:focus-visible, .logout-button:focus-visible{
  outline:0; box-shadow:var(--ring);
}

/* ---------- Exercises + animations ---------- */
@keyframes fadeInUp{ from{opacity:0; transform:translateY(10px)} to{opacity:1; transform:translateY(0)} }
@keyframes setSlideIn{ from{opacity:0; transform:translateX(12px)} to{opacity:1; transform:translateX(0)} }

#exerciseContainer{ display:none; }
#exerciseContainer[style*="block"]{ animation: fadeInUp var(--speed-med) ease both; }

.exercise-set{ display:none; counter-reset: ex; }
.exercise-set.active{ display:block; animation: setSlideIn var(--speed-med) ease both; }

.exercise{
  counter-increment: ex; position:relative; padding-left:40px;
  margin:12px 0; font-size:1.06rem; line-height:1.65;
}
.exercise::before{
  content: counter(ex);
  position:absolute; left:0; top:4px;
  width:28px; height:28px; border-radius:50%;
  background:#fff; border:2px solid var(--teal);
  color:var(--brand-900); font-weight:800; font-size:.95rem;
  display:grid; place-items:center;
  box-shadow:0 2px 8px rgba(0,0,0,.08);
}
.exercise p strong{ font-weight:800; color:var(--brand-900); background: rgba(60,160,208,.14); padding:3px 6px; border-radius:6px; }
.exercise p em{ color:var(--em); }

/* --- Drag & drop UI --- */
.dropzone{
  display:flex; flex-wrap:wrap; gap:10px; align-items:center;
  margin:10px 0 2px;
  padding:10px; border-radius:14px;
  background:rgba(3,71,105,.05);
  border:1.5px dashed var(--teal-28);
  min-height:56px;
}
.dropzone.dragging-over{
  background:rgba(85,144,136,.06);
  box-shadow:0 0 0 3px var(--teal-16) inset;
}

.word-bubble{
  display:inline-flex; align-items:center; justify-content:center;
  height:38px; padding:0 14px; border-radius:999px;
  background:#fff; border:1.5px solid rgba(3,71,105,.18);
  box-shadow:0 3px 10px rgba(0,0,0,.06);
  font-weight:700; letter-spacing:.2px; user-select:none; cursor:grab;
  transition:transform 120ms ease, box-shadow 180ms ease, border-color 180ms ease;
}
.word-bubble.adjective{ border-color:var(--teal-28); }
.word-bubble.dragging{ opacity:.85; transform:scale(.98); cursor:grabbing; box-shadow:0 6px 16px rgba(0,0,0,.12); }
.word-bubble:focus-visible{ outline:0; box-shadow:0 0 0 3px var(--teal-28); }

/* feedback + ikonka wrapper */
.feedback{ display:inline-flex; align-items:center; gap:8px; margin-left:10px; font-weight:800; vertical-align:middle; }
.feedback.correct{ color:#1f9d4d; background:rgba(255,255,255,.65); padding:2px 6px; border-radius:999px; box-shadow:0 0 0 1px rgba(31,157,77,.25) inset; }
.feedback.incorrect{ color:#d9534f; background:rgba(255,255,255,.65); padding:2px 6px; border-radius:999px; box-shadow:0 0 0 1px rgba(217,83,79,.25) inset; }

/* ===== INFO ICON ===== */
.explanation-icon{
  display:inline-flex; align-items:center; justify-content:center;
  width:24px; height:24px; margin-left:6px; border-radius:50%;
  background:var(--brand-700); color:#fff;
  border:2px solid var(--brand-900);
  box-shadow:0 2px 6px rgba(0,0,0,.2);
  cursor:pointer; user-select:none; position:relative; z-index:3;
  transition:transform .15s ease, background .25s ease, border-color .25s ease;
  vertical-align:middle; font-size:0;
}
.explanation-icon::before{
  content:"i"; position:absolute; top:50%; left:50%;
  transform:translate(-50%, -52%); font-size:13px; font-weight:900; line-height:1; color:#fff;
}
.explanation-icon:hover{ transform:scale(1.05); background:var(--accent); border-color:var(--accent); }
.explanation-icon:focus-visible{ outline:0; box-shadow:0 0 0 3px rgba(255,137,0,.35); }
.explanation-icon::after{
  content:attr(data-explanation);
  position:absolute; left:50%; transform:translateX(-50%) translateY(6px);
  bottom:calc(100% + 10px);
  min-width:180px; max-width:min(80vw, 360px);
  padding:10px 12px; border-radius:10px;
  background:#1f2b33; color:#fff; font-size:.92rem; line-height:1.45;
  box-shadow:0 8px 24px rgba(0,0,0,.45);
  opacity:0; visibility:hidden; pointer-events:none;
  transition:opacity var(--speed-fast), visibility var(--speed-fast), transform var(--speed-fast);
  z-index:10000;
}
.explanation-icon.active::after{ opacity:1; visibility:visible; transform:translateX(-50%) translateY(0); pointer-events:auto; }

/* ===== EXERCISE NAV ===== */
.exercise-nav-container{ display:flex; justify-content:center; align-items:center; gap:14px; margin:28px 0 12px; }
.exercise-nav-container .arrow-btn{
  all:unset; display:inline-grid; place-items:center;
  width:44px; height:44px; border-radius:999px;
  background:#fff; border:2px solid var(--brand-700); color:var(--brand-900);
  box-shadow:0 3px 10px rgba(0,0,0,.08);
  cursor:pointer; transition:transform 150ms ease, background 300ms, color 300ms, box-shadow 300ms;
}
.exercise-nav-container .arrow-btn i{ font-size:18px; line-height:1; }
.exercise-nav-container .arrow-btn:hover{ transform:translateY(-1px); background:var(--brand-700); color:#fff; box-shadow:0 6px 16px rgba(0,0,0,.14); }
.exercise-nav-container #showExercisesBtn{
  all:unset; display:inline-flex; align-items:center; justify-content:center;
  min-width:220px; height:46px; padding:0 24px; border-radius:999px;
  background:#fff; border:2px solid var(--brand-700); color:var(--brand-900);
  font-weight:800; letter-spacing:.2px; text-align:center;
  box-shadow:inset 0 0 0 2px rgba(60,160,208,.18), 0 3px 10px rgba(0,0,0,.08);
  cursor:pointer; transition:background 300ms, color 300ms, transform 150ms ease, box-shadow 300ms;
}
.exercise-nav-container #showExercisesBtn:hover{ background:var(--accent); color:#fff; transform:translateY(-1px); box-shadow:0 6px 16px rgba(0,0,0,.14); }

/* Check Answers */
.exercise-check{ display:flex; justify-content:center; align-items:center; width:100%; margin-top:28px; }
.btn-check{
  all:unset; display:inline-flex; align-items:center; justify-content:center;
  height:46px; min-width:230px; padding:0 22px; border-radius:999px;
  background:#fff; border:2px solid var(--brand-700); color:var(--brand-900);
  font-weight:800; letter-spacing:.2px;
  box-shadow:inset 0 0 0 2px rgba(60,160,208,.18), 0 3px 10px rgba(0,0,0,.08);
  cursor:pointer; transition:background 300ms, color 300ms, transform 150ms ease, box-shadow 300ms;
  margin:8px auto 0;
}
.btn-check:hover{ background:var(--accent); color:#fff; transform:translateY(-1px); box-shadow:0 6px 16px rgba(0,0,0,.14); }

/* ---------- SIDE MENU ---------- */
#side-menu{
  position:fixed; top:0; left:0;
  width:min(92vw, 450px); height:100dvh;
  background:
    radial-gradient(500px 300px at 0 0, var(--teal-16), transparent 60%),
    #034769;
  box-shadow:6px 0 22px rgba(0,0,0,.32);
  transform:translateX(-100%); transition:transform var(--speed-slow) ease;
  z-index:1002;

  display:flex; flex-direction:column;
  overflow:hidden auto; -webkit-overflow-scrolling:touch;

  padding:78px 14px 18px;
}
#side-menu.open{ transform:translateX(0); }

/* menu list padding under fixed header */
#side-menu ul.menu{
  list-style:none; margin:0;
  padding: calc(var(--hamburgerSafe) + var(--menuHeaderH)) 0 0;
  position:relative;
}
.menu li{ width:100%; }

/* SEARCH */
.search-container{
  position:fixed; left:14px;
  top: calc(var(--hamburgerSafe) + var(--menuTop));
  width: calc(min(92vw, 450px) - 28px);
  z-index:12;

  display:flex; align-items:center; gap:8px;
  height: var(--menuSearchH); padding:7px 12px; margin:0;
  border-radius:23px; background:#fff;
  border:1px solid var(--teal-35);
  box-shadow:0 6px 18px rgba(0,0,0,.25);
}
.search-input{ background:transparent; border:none; outline:none; width:100%; font-size:16px; color:#333; padding-left:8px; }
.search-btn{ background:transparent; border:none; cursor:pointer; font-size:18px; color:#333; width:32px; height:32px; display:grid; place-items:center; }

/* LOGOUT */
.menu a.logout-button, .logout-button{
  position:fixed; left:14px;
  top: calc(var(--hamburgerSafe) + var(--menuTop) + var(--menuSearchH) + var(--menuGap));
  width: calc(min(92vw, 450px) - 28px);
  z-index:12; margin:0;

  border:1px solid var(--teal-28);
  background: rgba(255,255,255,0.08);
}

/* items */
.menu a{
  display:flex; align-items:center; gap:10px; width:100%;
  color:#fff; text-decoration:none; font-size:1.03rem;
  padding:12px 16px;
  background: rgba(255,255,255,0.06);
  border:1px solid var(--teal-22);
  border-radius:12px;
  transition: background var(--speed-med), transform var(--speed-fast), box-shadow var(--speed-fast);
  margin:8px 0;
  white-space:normal; line-height:1.35;
  justify-content:flex-start;               /* default left-align */
}
.menu a:hover{
  background:#086FA1;
  box-shadow:inset 0 0 0 2px var(--teal-22);
  transform: translateY(-1px);
}

/* groups */
.menu > li{ margin-bottom:14px; }
.menu > li > a{
  font-weight:700;
  background: rgba(255,255,255,0.08);
  border:1px solid var(--teal-28);
}
.menu > li > a + .submenu{
  margin-top:8px; padding:10px; border-radius:14px;
  background: rgba(8,111,161,0.18);
  border:1px solid var(--teal-22);
  position:relative;
}

/* submenu block */
.submenu{ display:flex; flex-direction:column; overflow:hidden; border-radius:14px; background: rgba(8,111,161,0.18); border:1px solid var(--teal-22); }
.submenu a{
  display:flex; align-items:center; justify-content:flex-start;
  gap:12px; padding:12px 14px; margin:0;
  background: rgba(255,255,255,0.06);
  border-left:0; border-right:0; border-top:1px solid rgba(255,255,255,.08); border-bottom:0;
  position:relative;
}
.submenu a:first-child{ border-top:0; }
.submenu a:hover{ background:#0c5f80; box-shadow:inset 0 0 0 2px var(--teal-22); transform:translateY(-1px); }
/* bullet */
.submenu a::before{
  content:''; width:8px; height:8px; border-radius:50%;
  background:var(--teal); flex:0 0 8px; margin-right:4px;
}
/* REMOVE chevron (prevents “?” glyphs) */
.submenu a::after{ content:''; display:none; }

/* ---------- Search UX polish ---------- */
#side-menu.searching .menu a{ opacity:.55; filter:saturate(.8); }
#side-menu.searching li{ margin-bottom:10px; }
@keyframes hitPulse{ 0%{ box-shadow:0 0 0 0 var(--teal-45);} 100%{ box-shadow:0 0 0 8px rgba(85,144,136,0);} }
#side-menu.searching .menu a.search-hit{ opacity:1; background:#0f6b8a; border-color:var(--teal-45); box-shadow:0 6px 16px rgba(0,0,0,.18); animation: hitPulse .9s ease-out 1; }
#side-menu.searching li.has-hit > a{ opacity:1; background:#0d5e79; border-color:var(--teal-45); }
#side-menu.searching .submenu{ display:none; background: rgba(8,111,161,0.22); border-color: var(--teal-35); padding:8px; }
#side-menu.searching li.has-hit > .submenu{ display:block; }
#side-menu.searching li.has-hit > a{ position:relative; }
#side-menu.searching li.has-hit > a::before{
  content:""; position:absolute; left:8px; top:10px; bottom:10px; width:3px; border-radius:3px;
  background: linear-gradient(180deg, #3CA0D0, var(--teal));
}
#side-menu.searching .search-container{ box-shadow:0 10px 24px rgba(0,0,0,.35); border:2px solid var(--teal-45); }
#side-menu.searching .search-container::after{
  content:"Výsledky"; position:absolute; left:12px; bottom:-22px;
  padding:2px 10px; font-size:.82rem; letter-spacing:.2px;
  color:#e9f4f9; background:#0b5a75; border:1px solid var(--teal-35);
  border-radius:999px; box-shadow:0 4px 12px rgba(0,0,0,.25);
}
#side-menu.searching .submenu a{ background: rgba(255,255,255,0.10); border-color: var(--teal-35); }
#side-menu.searching .submenu a.search-hit{ background:#117997; border-color:var(--teal-45); }
#side-menu.searching ul.menu{ padding-top: calc(var(--hamburgerSafe) + var(--menuHeaderH) + 6px); }
#side-menu.searching .menu a:hover{ transform: translateY(-1px) scale(1.01); }

/* ---------- Hamburger ---------- */
.setting-btn{
  width:46px; height:46px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px;
  background:var(--brand-700); border-radius:10px; cursor:pointer; border:none;
  box-shadow:0 0 0 2px var(--brand-400); z-index:1003; position:fixed; top:20px; left:20px;
}
.bar{ width:50%; height:2px; background:#e5e5e5; border-radius:2px; position:relative; }
.bar::before{
  content:""; position:absolute; top:50%; left:50%; transform:translate(-50%,-50%);
  width:6px; height:6px; border-radius:50%; background:#7e75ff; border:2px solid #fff;
  box-shadow:0 0 6px rgba(255,255,255,.95); transition:left var(--speed-fast) ease;
}
.bar1::before{ left:calc(50% - 6px); }
.bar2::before{ left:calc(50% + 6px); }
.setting-btn:hover .bar1::before{ left:calc(50% + 6px); }
.setting-btn:hover .bar2::before{ left:calc(50% - 6px); }

/* ---------- Admin/Teacher ---------- */
#teacher-button, #admin-button{ position:fixed; top:20px; right:20px; z-index:1003; padding:0 16px; height:42px; min-width:120px; }
#admin-button{ right: calc(20px + 130px); }

/* ---------- Loader ---------- */
.loading{
  position:fixed; inset:0; display:flex; justify-content:center; align-items:center;
  background: rgba(255,255,255,0.8); z-index:9999;
  visibility:hidden; opacity:0; transition: opacity var(--speed-fast), visibility var(--speed-fast);
}
.loading.show{ visibility:visible; opacity:1; }
.loader{ border:14px solid #f3f3f3; border-top:14px solid #3498db; border-radius:50%; width:80px; height:80px; animation: spin 1.2s linear infinite; }
@keyframes spin{ to{ transform: rotate(360deg) } }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar{ width:12px }
::-webkit-scrollbar-track{ background: rgba(0,0,0,.06); border-radius:10px }
::-webkit-scrollbar-thumb{ background: rgba(3,71,105,.7); border-radius:10px; box-shadow: inset 0 0 6px rgba(0,0,0,.25) }
::-webkit-scrollbar-thumb:window-inactive{ background: rgba(3,71,105,.45) }

/* ===== Mobile ===== */
@media (max-width: 600px){
  .content{ padding: 6px; }
  .stylized-background{ margin: 6px; padding: 14px; border-radius: 14px; }
  .stylized-background p{ font-size: 1.02rem; line-height: 1.72; }
  .stylized-background p strong{ padding: 2px 6px; border-radius: 6px; background: rgba(60,160,208,.12); }
  .stylized-background p em{ color:var(--em); font-weight:600; }
  .stylized-background ul{ margin: 6px 0 12px 10px; padding-inline-start: 14px; }
  .stylized-background ul li{ margin-bottom:6px; }
  .stylized-background ul li::marker{ font-size:.85em; }
  .exercise{ margin:8px 0; line-height:1.55; padding-left:34px; }
  .exercise::before{ width:24px; height:24px; font-size:.85rem; }
  .dropzone{ gap:8px; min-height:52px; }
  .exercise-nav-container{ gap:10px; margin:18px 0 8px; }
  .exercise-nav-container .arrow-btn{ width:40px; height:40px; }
  .exercise-nav-container #showExercisesBtn{ min-width:180px; height:42px; }
  .btn-check{ min-width:200px; height:44px; }
}
@media (max-width: 420px){
  .content{ padding: 4px; }
  .stylized-background{ margin: 2px; padding: 12px; }
  .stylized-background ul{ margin-left: 8px; padding-inline-start: 12px; }
}

/* === TEXT-ALIGN MODES FOR MENU LABELS ============================ */
/* Add to <body>: menu-text-center OR menu-text-right */
body.menu-text-center #side-menu .menu a{ justify-content:center; text-align:center; gap:0; }
body.menu-text-center #side-menu .submenu a::before{ display:none; }

body.menu-text-right #side-menu .menu a{ justify-content:flex-end; text-align:right; gap:0; padding-right:18px; }
body.menu-text-right #side-menu .submenu a{ position:relative; padding-right:28px; }
body.menu-text-right #side-menu .submenu a::before{ left:auto; right:12px; margin:0; }
